package thread.singleton;

class SingletonThread {
    private static volatile SingletonThread instance = null;

    private SingletonThread() {

    }

    public static SingletonThread getInstance() {
        if (instance == null) {
            synchronized (SingletonThread.class) {
                if (instance == null) {
                    instance = new SingletonThread();
                }
            }
        }

        return instance;
    }
}

public class Demo3 {
}
